/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ConsultasProducciones;

import Conexion.Conexion;
import java.sql.*;
/**
 *
 * @author GJ_ASPRILLA
 */
public class Inventario {
    
    private static Conexion conn = Conexion.getInstance();
   
    /**
     *
     * @param args
     */
    public static void main (String[] args) {
        try {
            ResultSet rs;
            Statement statement;
            
            statement = conn.getConection().createStatement();
   String QueryString = "SELECT TOP 1000 [anho_InventarioBovinos] ,[nombre_Departamentos] ,[descripcion_TipoBovinos] ,[totalMachos_InventarioBovinos] ,[totalHembras_InventarioBovinos] FROM [AgronetEVA].[dbo].[VW_InventarioBovinos]";
            rs = statement.executeQuery(QueryString);
            System.out.println(rs);
            System.out.println("anho_InventarioBovinos  nombre_Departamentos   descripcion_TipoBovinos   totalMachos_InventarioBovinos         totalHembras_InventarioBovinos");
            int count = 0;
            while (rs.next()) { 
                System.out.println(rs.getString(1) + "                   " + rs.getString(2) + "                " + rs.getString(3) + "               " + rs.getString(4) + "                               " + rs.getString(5));
                count=++count;
                System.out.print(count);
            }
        } catch (Exception ex) {
            System.out.println("Unable to connect to batabase.");
        }
        
    }
}

